package com.dou.controller;

import com.dou.entity.User;
import com.dou.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@CrossOrigin
public class UserController {
    @Autowired
    private UserService userService;


    @RequestMapping("/query")
    @ResponseBody
    public List<User> query(){
        return userService.getAllUser();
    }
}
